# -*- coding: utf-8

def train_info(args, name):
	file = open("./Clinic_log_info.txt", "a+")
	name = name[7:]
	info = args.BaseNet_version + "___" + "K-fold:" + str(args.k_fold) + "___" + "lr0:" + str(args.lr[0]) +"-"+ "lr1:" + str(args.lr[1]) + "___" + "save:" + args.save_model_path
	dataset = args.data
	# note = "完整的跑完当前版本,resnet101,dataset2016,看下训练信息,引入dropout" \
	#        "和输入归一化,使用SGD优化器,V7-边界辅助分割，利用边界图辅助,sigmoid的特征注意力,去掉iou损失"
	# note = "CCA_CGL : 复现Cascaded Context Enhancement for Automated Skin Lesion Segmentation, 没有weight_decay"
	note = "ours: 在临床图像7点数据集上,边界图辅助分割,同上CPF和CE用resnet34"
	file.write(name + "\n")
	file.write(info + "\n")
	file.write(note + "\n")
	file.write(dataset + "\n")
	file.write("\n\n")



class DefaultConfig(object):
	checkpoint_step = 5
	validation_step = 1
	crop_height = 256
	crop_width = 256
	
	num_epochs = 200          # **
	epoch_start_i = 0
	
	batch_size = 16            # **
	batch_size_val = 1        # **
	batch_size_test = 1
	
	#  backbone   other
	lr = [0.01, 0.01]                 # **
	cuda = '1,2'                        # **
	
	save_model_path ='../checkpoint/V12-f1'   # **
	k_fold = 1                        # 验证集和测试集对应的f*

	# data = "/media/wz209/a29353b7-1090-433f-b452-b4ce827adb17/JZT/segmentation/ISIC_2016"
	# data = "/media/wz209/a29353b7-1090-433f-b452-b4ce827adb17/JZT/segmentation/ISIC_2017"
	# data = "/media/wz209/a29353b7-1090-433f-b452-b4ce827adb17/JZT/segmentation/ISIC_2018"
	# data = "/media/wz209/a29353b7-1090-433f-b452-b4ce827adb17/JZT/segmentation/Dermquest"
	# data = "/media/wz209/a29353b7-1090-433f-b452-b4ce827adb17/JZT/segmentation/Derm7pt"
	data = "/media/wz209/a29353b7-1090-433f-b452-b4ce827adb17/JZT/segmentation/XiangYaDerm"
	
	dataset = "k_folder"
	log_dirs = 'log'
	
	lr_mode = 'poly'
	net_work = 'BaseNet'
	momentum = 0.9  #
	weight_decay = 1e-4  #
	mode = 'train'
	num_classes = 1  # 分割的类别数(1或者C+1)
	num_workers = 8
	use_gpu = True
	pretrained_model_path = '../Derm/model_002_0.9034.pth'
	BaseNet_version = "None"
	
	# dice jacd accu epoch
	b_dice = [0, 0, 0, 0, 0, 0]
	b_jacd = [0, 0, 0, 0, 0, 0]
	b_accu = [0, 0, 0, 0, 0, 0]
	b_sen = [0, 0, 0, 0, 0, 0]
	b_spc = [0, 0, 0, 0, 0, 0]






